package apiday03home;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;

public class CollectionToArray {
    public static void main(String[] args) {
        Collection<String> c = new ArrayList<>();
        c.add("one");
        c.add("#");
        c.add("two");
        c.add("#");
        c.add("three");
        c.add("#");
        String[] array = c.toArray(new String[5]);
        System.out.println(Arrays.toString(array));

        String[] array1 = {"one", "two", "three", "four", "five"};
        System.out.println("array:"+ Arrays.toString(array1));
    }
}
